package mnnu.ghbe.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * OpenAI配置类
 * 用于读取配置文件中的API密钥、基础URL和相关参数
 */
@Component
@ConfigurationProperties(prefix = "openai")
public class OpenAIConfig {
    
    /**
     * OpenAI API密钥
     */
    private String apiKey;
    
    /**
     * OpenAI API基础URL
     */
    private String baseUrl;
    
    /**
     * 要使用的模型名称
     */
    private String modelName = "gpt-3.5-turbo";
    
    /**
     * OCR功能的默认提示词
     */
    private String ocrPrompt = "请识别图片中的文字内容";
    
    /**
     * 连接超时时间（秒）
     */
    private Integer connectTimeout = 30;
    
    /**
     * 读取超时时间（秒）
     */
    private Integer readTimeout = 60;
    
    /**
     * 写入超时时间（秒）
     */
    private Integer writeTimeout = 60;

    public String getApiKey() {
        return apiKey;
    }

    public void setApiKey(String apiKey) {
        this.apiKey = apiKey;
    }

    public String getBaseUrl() {
        return baseUrl;
    }

    public void setBaseUrl(String baseUrl) {
        this.baseUrl = baseUrl;
    }

    public String getModelName() {
        return modelName;
    }

    public void setModelName(String modelName) {
        this.modelName = modelName;
    }
    
    public String getOcrPrompt() {
        return ocrPrompt;
    }
    
    public void setOcrPrompt(String ocrPrompt) {
        this.ocrPrompt = ocrPrompt;
    }

    public Integer getConnectTimeout() {
        return connectTimeout;
    }

    public void setConnectTimeout(Integer connectTimeout) {
        this.connectTimeout = connectTimeout;
    }

    public Integer getReadTimeout() {
        return readTimeout;
    }

    public void setReadTimeout(Integer readTimeout) {
        this.readTimeout = readTimeout;
    }

    public Integer getWriteTimeout() {
        return writeTimeout;
    }

    public void setWriteTimeout(Integer writeTimeout) {
        this.writeTimeout = writeTimeout;
    }
}